import base from './base'
class Cache {
    setitem(key, value) {
        let str = base.encode(value)
        if (str) {
            window.localStorage.setItem(key, str)
        }
    }
    getitem(key) {
        let str = window.localStorage.getItem(key)
        if (str) {
            let value = base.decode(str)
            if (value) {
                return value
            }
        }
    }
    remove(key) {
        if (key) {
            window.localStorage.removeItem(key)
        }
    }
}
export default new Cache()